/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.skuboard.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author clockbuilder
 */
@Embeddable
public class CoursesHasStudentsPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "courses_id")
    private String coursesId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "students_studentId")
    private String studentsstudentId;

    public CoursesHasStudentsPK() {
    }

    public CoursesHasStudentsPK(String coursesId, String studentsstudentId) {
        this.coursesId = coursesId;
        this.studentsstudentId = studentsstudentId;
    }

    public String getCoursesId() {
        return coursesId;
    }

    public void setCoursesId(String coursesId) {
        this.coursesId = coursesId;
    }

    public String getStudentsstudentId() {
        return studentsstudentId;
    }

    public void setStudentsstudentId(String studentsstudentId) {
        this.studentsstudentId = studentsstudentId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (coursesId != null ? coursesId.hashCode() : 0);
        hash += (studentsstudentId != null ? studentsstudentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CoursesHasStudentsPK)) {
            return false;
        }
        CoursesHasStudentsPK other = (CoursesHasStudentsPK) object;
        if ((this.coursesId == null && other.coursesId != null) || (this.coursesId != null && !this.coursesId.equals(other.coursesId))) {
            return false;
        }
        if ((this.studentsstudentId == null && other.studentsstudentId != null) || (this.studentsstudentId != null && !this.studentsstudentId.equals(other.studentsstudentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.skuboard.entity.CoursesHasStudentsPK[ coursesId=" + coursesId + ", studentsstudentId=" + studentsstudentId + " ]";
    }
    
}
